<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableArticleCategoryOperateDailyStatistics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_category_operate_daily_statistics', function (Blueprint $table) {
            $table->id();

            $table->date("date")->default(0)->comment("统计日期");
            $table->unsignedBigInteger("targetId")->default(0)->comment("目标id 0 代表全部");
            $table->unsignedTinyInteger("operateType")->default(0)->comment("类型");

            $table->unsignedInteger("increaseNum")->default(0)->comment("新增数");
            $table->unsignedInteger("cancelNum")->default(0)->comment("取消数");
            $table->unsignedInteger("netNum")->default(0)->comment("净值数");
            $table->unsignedInteger("totalNum")->default(0)->comment("总数");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '专题每日统计数据';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_category_operate_daily_statistics');
    }
}
